#include<bits/stdc++.h>
using namespace std;
int main()
{
	int m,n,r=1,t,a;
	cin>>m>>n;
	a=m*n;
	if(m<n)
	{
		r=m;
		m=n;
		n=r;
	}
	while(r!=0)
	{
		r=m%n;
		m=n;
		n=r;
	}
	cout<<m<<endl<<a/m;
    return 0;
}

